/*
Copyright 2010-2011 CumulusCloud
http://cumuluscloud.cc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cumulusCloud.common;

import cumulusCloud.knowledge.ApplicationKnow;

/**
 * This class gives information and can modify the cloud web applications
 * 
 * @author Simon Levesque
 */
public class ManageApplication {
	static private ApplicationKnow know = ApplicationKnow.getInstance();
	
	/**
	 * To remove a web application.
	 * It will only remove the WAR file and the deployment (not the users data unless they were saved there).
	 * It might take some seconds before the deployment is deleted.
	 * 
	 * @param appName The name of the application
	 * @return True if the application existed and is removed
	 */
	public static boolean deleteApplication(String appName) {
		return know.deleteApplication(appName);
	}
	
	/**
	 * To get a web url for the icon of a specific application
	 * 
	 * @param appName The name of the application
	 * @return The URL to the icon
	 */
	public static String getApplicationIconURL(String appName) {
		return know.getApplicationIconURL(appName);
	}
	
	/**
	 * To get the name of all the installed applications
	 * 
	 * @return The names
	 */
	public static String[] listApplicationsDirsNames() {
		return know.listApplicationsDirsNames();
	}
}
